<?php
	
	class model_setting extends Application{
		function __construct(){
			//load basic for model
		}
        function modellist(){
            return return_array_multi("SELECT model_id FROM `dos_sys_models`");
        }
        function insertModel($modelid, $modelload){
            exec_string("INSERT INTO dos_sys_models(model_id, model_name) VALUES('$modelid', 'model_$modelid')");
            if($modelload){
    			exec_string("DELETE FROM dos_sys_loads WHERE dos_sys_models_model_id = '$modelid'");
    			foreach($modelload as $item){
    				exec_string("INSERT INTO dos_sys_loads(load_name, dos_sys_models_model_id) VALUES('$item', '$modelid')");
    			}
                exec_string("INSERT INTO dos_sys_loads(load_name, dos_sys_models_model_id) VALUES('$modelid', '$modelid')");
    		}
        }
	}
	
?>